public class Main {
    public static void main(String[] args) {

        int month = 1;

        String name = switch (month) {
            case 3, 4, 5 -> "spring";
            case 6, 7, 8 -> "summer";
            case 9, 10, 11 -> "autumn";
            case 12, 1, 2 -> "winter";
            default -> "wrong";
        };

        System.out.println(name);

        funSwitch(new Animal());
        funSwitch(new Human());
    }

    static void funSwitch(Object o){
        switch (o){
            case Human h -> h.haveFun();
            case Animal a -> a.haveFun();
            case null, default -> System.out.println("error.");
        }
    }
}

interface HaveFun{
    default void haveFun(){
        System.out.println("sleep");
    }
}

class Human implements HaveFun{
}

class Animal implements HaveFun{
    @Override
    public void haveFun() {
        System.out.print("Animal: ");
        HaveFun.super.haveFun();
    }
}
